﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MeterialOrderAdd.aspx.cs" Inherits="WebSite.admin.order.MeterialOrderAdd" %>
<%@ Register src="../../Controls/AddressArea.ascx" tagname="AddressArea" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

   <head id="Head1" runat="server">
    <title>良臣直销网 </title>
     <link href="../main.css" rel="stylesheet" type="text/css" />
    <script language="javascript">
        parent.maintitle.innerHTML = "订单管理";
        parent.contentmain.innerHTML = "<span class='title01'>所在位置：</span>添加现货订单"
    </script>
    <script language='javascript' type="text/jscript">
        var path = (window.top.location).toString();
        if (path.indexOf('login.aspx') == -1) {
            if (path.indexOf('index.aspx') == -1) {
                window.top.location = 'index.aspx';
            }
        }
	</script>




     <script language="javascript" type="text/javascript">

         function SetNum(id) {

             var oNum = document.getElementById(id);
             if (!isNaN(oNum.value)) {
                 if (oNum.value < 0) {
                     oNum.value = 1;
                 }
             }
             oNum.value = parseInt(oNum.value);
         }

         function checkForm() {
           //  alert('<%=txtUserName.ClientID %>');
             var userName = document.getElementById('<%=txtUserName.ClientID %>');
             //alert(userName.value);
             var tel = document.getElementById('<%= txtTel.ClientID %>');
             var phone = document.getElementById('<%= txtPhone.ClientID %>');;
             var address = document.getElementById('<%= txtAddress.ClientID %>');
             if (userName.value == "") {
                 alert('收件人不能为空!');
                 userName.focus();
                 return false;
             } else if (tel.value == "" && phone.value == "") {
                 alert('手机与电话至少填一项！');
                 tel.focus();
                 return false;
             }  else if (address.value == "") {
                 alert("地址不能为空!");
                 address.focus();
                 return false;
             }
         
         }
    
   </script>

   <style type="text/css">
     
      .HiddRow
      {
          visibility : hidden;
          }
     
       .box
       {}
     
   </style>
</head>

<body  bgcolor="#F1F4F7">
    <form id="form1" runat="server">
    <div style="padding-left:10px">
    <br />
  <table Width="98%" border="0" cellspacing="0" cellpadding="3">
    <tr>
    <td> 

      订单编号：<asp:Label ID="lblOrderCode" ForeColor="Red" runat="server" Text=""></asp:Label>
     </td>
    </tr>
   
    <tr>
    <td>
        请选择商家：<asp:DropDownList ID="ddlCompany" runat="server"></asp:DropDownList>
        <br />
        </td>
        <td>
            &nbsp;</td>
    </tr>

    <tr>
    <td>
         价格从 
        <asp:TextBox ID="txtPriceFrom" runat="server" Width="80px"></asp:TextBox>
     
        到
        <asp:TextBox ID="txtPriceTo" runat="server" Width="80px"></asp:TextBox>
        &nbsp;&nbsp; 商品关键字：<asp:TextBox ID="txtKeywords" runat="server" Width="300px"></asp:TextBox>
         <asp:ImageButton ID="ibtnSearch" ImageUrl="../images/button04.gif" runat="server" OnClick="ibtnSearch_Click" />
 
        </td>  
    </tr>

    <tr>
    <td>
        <asp:DropDownList ID="ddlProductList" runat="server">
        </asp:DropDownList>数量
        <asp:TextBox ID="txtNum" runat="server" Width="56px"></asp:TextBox>

           <asp:ImageButton ID="ibtnAddProduct" ImageUrl="../images/button05.gif" runat="server" OnClick="ibtnAddProdut_Click" />
      
        </td>  
    </tr>
    <tr>
    <td>
     
   <asp:GridView ID="GridView1" runat="server" Width="98%" CellPadding="4" 
            ForeColor="#333333" DataKeyNames="proid" AutoGenerateColumns="False" 
            AllowPaging="false" pagesize="100" BorderStyle="Solid" BorderWidth="1px" 
      ShowFooter="false" EmptyDataText="没有数据记录！！" AllowSorting="True" 
            onrowcommand="GridView1_RowCommand" >
        <Columns>
        
        <asp:HyperLinkField DataNavigateUrlFields="proid"  DataNavigateUrlFormatString="orders.aspx?oid={0}" HeaderText="产品号" DataTextField="proid"  ItemStyle-Width="100px"/>
          
          <asp:TemplateField  HeaderText="产品名称">
           <ItemStyle VerticalAlign="Middle"  />
             <ItemTemplate>
             <a href='/cn/products_details.aspx?pid=<%#Eval("proid")%>' target='_blank'>
            <%# Eval("proname")%></a> 
             </ItemTemplate>
        </asp:TemplateField>

          <asp:TemplateField  HeaderText="数量">
           <ItemStyle  HorizontalAlign="Center"  Width="50px"  />
             <ItemTemplate>
             <asp:TextBox ID="txtNum" runat="server"  onMouseOut="SetNum(this.id)" Enabled="false" Text='<%#Eval("ProdNumber")%>'   Width="30px"></asp:TextBox>
             </ItemTemplate>
        </asp:TemplateField>
             <asp:TemplateField  HeaderText="价格">
           <ItemStyle  HorizontalAlign="Right"  Width="60px" />
             <ItemTemplate>
             <asp:Label ID="lblPrice" runat="server" Text='<%#Eval("ProdPrice")%>' Width="30px"></asp:Label>
             </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="companyOnSale" HeaderText="折扣" />
            <asp:TemplateField  HeaderText="总价">
           <ItemStyle  HorizontalAlign="Right"  Width="60px" />
             <ItemTemplate>
             <asp:Label ID="lblAmount" runat="server" Text='<%#Eval("SumPrice")%>'  ></asp:Label>
             </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField  HeaderText="操作" ItemStyle-Width="120px" ItemStyle-HorizontalAlign="Center">
             <ItemTemplate>
             <asp:LinkButton id="lbtEdit" Text="编辑" CommandName="edi"  CommandArgument='<%# Container.DataItemIndex %>'  runat="server"></asp:LinkButton>
             &nbsp; 
          <asp:LinkButton id="lbtSave" Text="保存" CommandName="sav" Visible="false" CommandArgument='<%# Container.DataItemIndex %>'  runat="server"></asp:LinkButton> 
            &nbsp;
             <asp:LinkButton id="lbtCancel" Text="取消" CommandName="can" Visible="false" CommandArgument='<%# Container.DataItemIndex %>'  runat="server"></asp:LinkButton> 
             &nbsp;
              <asp:LinkButton id="lblDelete" Text="删除"  OnClientClick="return confirm('确认要删除吗？');" CommandName="del" CommandArgument='<%# Container.DataItemIndex %>'  runat="server"></asp:LinkButton>  
             </ItemTemplate>
        </asp:TemplateField>
         
      
        </Columns>
             <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />             
             <PagerStyle BackColor="White" ForeColor="#333333" HorizontalAlign="Center" Font-Bold="True" Font-Size=30px />
             <HeaderStyle BackColor="#E2E7EB" Font-Bold="True" ForeColor="Black" HorizontalAlign="Left" />
             <AlternatingRowStyle BackColor="White" />
             <PagerSettings Visible="False" />
    </asp:GridView>

    </td>
    </tr>
    <tr><td><strong>送货地址</strong></td></tr>
    <tr>
        <td>
    <table width="95%" border="0" cellpadding="0" cellspacing="1" >

	
             <tr>
		       <td height="25" align="right">实物名称：</td>
		      <td align="left" >　
	           <asp:TextBox ID="txtMaterialName" CssClass="box" runat="server" size="20" 
                      maxlength="200" Width="456px"></asp:TextBox>
                   *</td>
	        </tr>

	
             <tr>
		       <td height="25" align="right">收件人：</td>
		       <td align="left" >　
	           <asp:TextBox ID="txtUserName" CssClass="box" runat="server" size="20" maxlength="100"></asp:TextBox>
                   *</td>
	        </tr>
		     <tr>
		       <td height="25" align="right" >联系电话：</td>
		       <td align="left">　
	           <asp:TextBox ID="txtTel" CssClass="box" runat="server" size="20" maxlength="100"></asp:TextBox>
                   &nbsp;
                   电话和手机至少填一项</td>
	        </tr>
		     <tr>
		       <td height="25" align="right" >手 机：</td>
		       <td align="left" >　
	           <asp:TextBox ID="txtPhone" CssClass="box" runat="server" size="20" maxlength="100"></asp:TextBox></td>
	        </tr>
		     <tr style="display:none">
		       <td height="25" align="right" >邮 编：</td>
		       <td align="left" >　
	           <asp:TextBox ID="txtPost" CssClass="box" runat="server" size="20" maxlength="100"></asp:TextBox>*</td>
	        </tr>
		     <tr>
		       <td height="25" align="right" >地 址：</td>
		       <td align="left" >　
	            
                   <uc1:AddressArea ID="AddressArea1" runat="server" />
	           <asp:TextBox ID="txtAddress" CssClass="box" runat="server" 
                       maxlength="200" Width="323px"></asp:TextBox>*</td>
	        </tr>
		     <tr>
		       <td height="25" align="right">送货日期：</td>
		       <td align="left" >　
	            <asp:TextBox ID="txtSendDate" CssClass="box"  style="behavior:url('../../LWDP.HTC'); width: 80px;" runat="server"
                        ></asp:TextBox></td>
	        </tr>
		    
		      <tr>
		       <td height="25" align="right" >备注：</td>
		       <td align="left" >　
	           <asp:TextBox ID="txtRemark" CssClass="box" runat="server" MaxLength="300"
                       Width="455px"></asp:TextBox>*</td>
	        </tr>
		    
	      </table>
          </td>
    </tr>

  </table>

    
    </div>
    <div align="center">
    
      <asp:ImageButton ID="ibtnSubmit" ImageUrl="../images/btnSubmit.gif" runat="server" OnClick="ibtnSubmit_Click" />
      
     
    </div>
    </form>
</body>
</html>
